<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>

<style type="text/css">
	#red{
		width: 100px;
		height: 100px;
		background: red;
	}
	
	#blue{
		width: 100px;
		height: 100px;
		background: blue;
	}
</style>

<script type="text/javascript">
var isVisible=true;
var red;

function init(){
	red = document.getElementById( "red" );
}

function visiblity(){
	isVisible = !isVisible;
	red.style.visibility = ( isVisible === true ) ? "visible" : "hidden";
	
}
</script>

</head>



<body onload="init()">
	<div id="red"></div>
	<div id="blue"></div>
	<input type="button" onclick="visiblity();" value="visiblity"/>
</body>
</html>